import instance from "@/http/index.js";

export const registerApi = ({ account, password }) => {
  return instance({
    url: "/api/register",
    method: "post",
    data: {
      account,
      password,
    },
  });
};

export const loginApi = ({ account, password }) => {
  return instance({
    url: "/api/login",
    method: "post",
    data: {
      account,
      password,
    },
  });
};

/**
 * 验证账户与邮箱是否一致
 * @data {string} account email
 */
export const verifyAccountAndEmailApi = ({ account, email }) => {
  return instance({
    url: "/user/verifyAccountAndEmail",
    method: "post",
    data: {
      account,
      email,
    },
  });
};

/**
 * 忘记密码
 * @data {string} id newPassword
 */
export const changePasswordInLogin=(id,newPassword)=>{
    return instance({
        url:'/user/changePasswordInLogin',
        method:'post',
        data:{
            id,
            newPassword,
        }
    })
}
